/*
 * Copyright 2010 Original Author(s)
 * 
 * This file is part of Kommando
 * 
 * Kommando is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * Kommando is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with Kommando.  If not, see <http://www.gnu.org/licenses/>.
 */

package org.kommando.application.win32;

import java.io.File;
import java.io.IOException;

import org.kommando.application.core.Application;

/**
 * win32 {@link Application}
 * 
 * @author Peter De Bruycker
 */
public class Win32Application extends Application {

    private Win32ApplicationContext context;

    public Win32Application(Win32ApplicationContext context, File file) {
        super(file);

        this.context = context;
    }

    @Override
    public boolean isOpen() {
        try {
            return context.isOpen(getFile());
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

        return false;
    }

    @Override
    public void exit() {
        try {
            context.exit(getFile());
        } catch (Exception e) {
            // TODO: handle exception
            e.printStackTrace();
        }
    }

}
